cmake_minimum_required(VERSION 3.1.4)

include_directories(
    ${PROJECT_SOURCE_DIR}/lib/linkedlist
    ${PROJECT_SOURCE_DIR}/lib/bilinkedlist
    ${PROJECT_SOURCE_DIR}/lib/skiplist
    ${PROJECT_SOURCE_DIR}/kernel
    )

include(FetchContent)
FetchContent_Declare(
    googletest
    # Specify the commit you depend on and update it regularly.
    #GIT_REPOSITORY https://github.com/google/googletest.git
    #GIT_TAG        release-1.8.0
    URL https://codeload.github.com/google/googletest/tar.gz/refs/tags/release-1.8.0
    SOURCE_DIR  ${PROJECT_SOURCE_DIR}/thirdparty/googletest
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

add_executable(gtest_linkedlist gtest_linkedlist.cpp)
target_link_libraries(gtest_linkedlist TryAlgo)
target_link_libraries(gtest_linkedlist gtest_main)

add_executable(gtest_bilinkedlist gtest_bilinkedlist.cpp)
target_link_libraries(gtest_bilinkedlist TryAlgo)
target_link_libraries(gtest_bilinkedlist gtest_main)

add_executable(gtest_skiplist gtest_skiplist.cpp)
target_link_libraries(gtest_skiplist TryAlgo)
target_link_libraries(gtest_skiplist gtest_main)

add_executable(gtest_msgqueue gtest_msgqueue.cpp)
target_link_libraries(gtest_msgqueue Kernel)
target_link_libraries(gtest_msgqueue gtest_main)

add_executable(gtest_list gtest_list.cpp)
target_link_libraries(gtest_list Kernel)
target_link_libraries(gtest_list gtest_main)

add_executable(gtest_thrdpool gtest_thrdpool.cpp)
target_link_libraries(gtest_thrdpool Kernel)